<template>
  <div>
    <div class="top-header">
      <div class="header-title">
        听写我帮忙<sub>《后台管理》</sub>
      </div>
      <el-row class="right-menus">
        <el-col span="8">曾孝</el-col>
        <el-col span="8">消息</el-col>
        <el-col span="8">退出</el-col>
      </el-row>
    </div>
    <container :out-height="80" style="position:relative;">
      <el-menu
        class="work-leftmenu"
        default-active="2"
        @open="handleOpen"
        @close="handleClose">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>导航一</span>
          </template>
          <el-menu-item-group>
            <template slot="title">分组一</template>
            <el-menu-item index="1-1">选项1</el-menu-item>
            <el-menu-item index="1-2">选项2</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="分组2">
            <el-menu-item index="1-3">选项3</el-menu-item>
          </el-menu-item-group>
          <el-submenu index="1-4">
            <template slot="title">选项4</template>
            <el-menu-item index="1-4-1">选项1</el-menu-item>
          </el-submenu>
        </el-submenu>
        <el-menu-item index="2">
          <i class="el-icon-menu"></i>
          <span slot="title">导航二</span>
        </el-menu-item>
        <el-menu-item index="3" disabled>
          <i class="el-icon-document"></i>
          <span slot="title">导航三</span>
        </el-menu-item>
        <el-menu-item index="4">
          <i class="el-icon-setting"></i>
          <span slot="title">导航四</span>
        </el-menu-item>
      </el-menu>
      <container :out-width="300" style="margin-left:300px;">
        <async-load :module='comp' :space='vuexspace' ></async-load>
      </container>
    </container>
  </div>
</template>

<script lang="ts">
import Vue from 'vue';
import * as module from '../index.model';
import {WorkArea} from '../../module';

export default Vue.proxyVue({
  module,
  init(initData){
    return {
      comp:WorkArea,
      vuexspace:['workarea'],
      modelData:initData
    };
  },
  props:{
    space:{
      type: Array
    }
  },
  methods:{
  }
})
</script>

<style lang="less" scoped>
@import '~theme.less';
@leftMenu:220px;
.top-header{
  line-height: 80px;
}
.header-title{
  text-indent: 25px;
  margin-right: @leftMenu;
}
.right-menus{
  position: absolute;
  right: 0px;
  width: @leftMenu;
  top: 0 ;
  font-size: 16px;
  > div{
    text-align: center;
    cursor: pointer;
  }
}
.work-leftmenu{
  width: 300px;
  position: absolute;
  left: 0px;
  top:0px;
  height:100%;
}
</style>
